package com.vincent.core.web;

import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

/**
 * @author vincent
 * @date 2019/10/14
 * @description
 * RestTemplate自动注入，声明了一个restTemplate
 */
@Configuration
public class RestTemplateAutoConfigure {
    @Bean(name = "restTemplate")
    @ConditionalOnMissingBean(name = "restTemplate")
    public RestTemplate restTemplate(){
        return new RestTemplate();
    }
}
